package kolekcje.powtorka;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class MusicBoxSetter {

	private static String[] songs = { "Pink Moon/Nick Drake/5/80",
			"Somersault/Zero 7/4/84", "Listen/Tahiti 80/5/90",
			"Shiva Moon/Prem Joshua/6/120", "Circles/BT/5/110",
			"Deep Channel/Afro Celts/4/120", "Passenger/Headmix/4/100",
			"Listen/Tahiti 80/5/90", "Listen/Tahiti 80/5/90",
			"Listen/Tahiti 80/5/90" };

	public static File file = new File("songs.txt");

	public static void main(String[] args) {

		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(file));
			for (String e : songs)
				bw.write(e + "\n");
			bw.close();
			
			BufferedReader br = new BufferedReader(new FileReader(file));
			String s;
			while((s = br.readLine()) != null)
				System.out.println(s);
			System.out.println();
			System.out.println(file.getAbsolutePath());
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
